package com.vne.skyemart.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.vne.skyemart.dao.PaymentTypeDao;
import com.vne.skyemart.model.PaymentType;
import com.vne.skyemart.service.PaymentTypeService;

@Service("paymentTypeService")
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true)
public class PaymentTypeServiceImpl implements PaymentTypeService{
	@Autowired
	private PaymentTypeDao paymentTypeDao;

	public PaymentTypeDao getPaymentTypeDao() {
		return paymentTypeDao;
	}

	public void setPaymentTypeDao(PaymentTypeDao paymentTypeDao) {
		this.paymentTypeDao = paymentTypeDao;
	}
	public PaymentTypeServiceImpl() {}
	@Transactional(propagation = Propagation.SUPPORTS,readOnly = false)
	@Override
	public void addPaymentType(PaymentType paymenttype) {
		paymentTypeDao.save(paymenttype);
	}

	@Override
	public List<PaymentType> listPaymentType() {
		return paymentTypeDao.findAll();
	}
	
}
